<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <!-- <meta http-equiv="refresh" content="2;url=http://www.baidu.com"> -->
  <title>Document</title>
  <style media="screen">
    #father{
      width: 200px;
      height: 200px;
      margin: 100px auto;
      border:1px rgb(19, 27, 29) solid;
      display: flex;
      justify-content:center;
      align-items: center;
    }
    #div{
      width: 100px;
      height: 100px;
      border:10px pink solid;
      padding:20px;

      box-sizing: content-box;
      /*
      content-box这个属性padding和border不包含在宽高总宽度
      width = width+border+padding
      总宽度为 160
      */
      box-sizing: border-box;
      /*
        border-box这个属性的padding和border都包含在宽高内
        width+border+padding = width
        总宽度为100
       */
    }
  </style>
</head>
<body>
  <div id="father">
      <div id="div"></div>
  </div>
</body>
</html>
